Skip to content

_loader/loader.py: Add None checks for shallow loading#1975

Merged
juergbi merged 1 commit intomasterfrom
juerg/loader
Dec 11, 2024
Merged

_loader/loader.py: Add None checks for shallow loading#1975
juergbi merged 1 commit intomasterfrom
juerg/loader

Conversation

@juergbi
Copy link
Contributor

@juergbi juergbi commented Nov 29, 2024

When performing shallow loads without loading subprojects, get_loader() may return None. Add checks for that to fix crashes dereferencing None.

@gtristan
Copy link
Contributor

gtristan commented Dec 6, 2024

It would be good to document the functions which can newly now return None, and hopefully even document why they can now return None.

Copy link
Contributor

@gtristan gtristan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, this might or might not fix the crashes but doesn't break tests and is otherwise harmless, possibly helping us track down issues which were leading to this None dereferencing.

@juergbi juergbi marked this pull request as ready for review December 11, 2024 11:14
When performing shallow loads without loading subprojects,
`get_loader()` may return `None`. Add checks for that to fix crashes
dereferencing `None`.
@juergbi juergbi merged commit 491440a into master Dec 11, 2024
17 checks passed
@juergbi juergbi deleted the juerg/loader branch December 11, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants